<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.minshenglife.zanzan.pub.Config" %>
	<%
	String rootPath = Config.getProperty(Config.WX_BASEURL);//应用的根路径
	%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=rootPath%>">
    <title>查看管理员</title>  
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
  </head>
  
  <body>
     <table border="1px" style="width: 100%;" > 
    	<tr>
			<td  width="15%" align="center">员工号</td>
			<td  width="25%" align="center">姓名</td>
			<td  width="15%" align="center">管理区域</td>
			<td  width="10%" align="center">管理员等级</td>
			<c:choose>
			   <c:when test="${govern}">  
			      <td width="10%"  align="center">高级管理员操作</td>
			   </c:when>
			   <c:otherwise> 
			   </c:otherwise>
			</c:choose>
		</tr>
		<c:forEach items="${managerList}" var="each" varStatus="vars">
			<tr>
				<td align="center">
					${each.empId}
				</td>
				<td align="center">
					${each.emp_name}
				</td>
				<td align="center">
					${each.dept_name}
				</td>
				<td align="center">
					<c:choose>
				   		<c:when test="${each.grade != '0'}">  
				   			高级管理员
				   		</c:when>
				   		<c:otherwise>
				   			普通管理员 
				   		</c:otherwise>
					</c:choose>
				</td>
				<td align="center">
				<c:choose>
			   		<c:when test="${govern}">  
						<input type="button" onclick="deleteManager('${each.empId}');" value="&nbsp;&nbsp;删除管理员&nbsp;&nbsp;">
			   		</c:when>
			   		<c:otherwise> 
			   		</c:otherwise>
				</c:choose>
				</td>
			</tr>
		</c:forEach>
    </table>
  </body>
</html>
<script type="text/javascript" src="<%=rootPath%>/jsp/power/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
	function deleteManager(empId){
		$.ajax({
			url:"<%=rootPath%>/userLogin/deleteManagerEmp.power",
			type: 'GET',
			dataType: "TEXT",
			data:'empId='+empId,
			async: false,
			success: function (obj){
				alert(obj);
				window.location.href ="<%=rootPath%>/userRole/loadUserRole.power";
			}
		})
	}
</script>
